<script setup lang="ts">
import { toRefs } from "vue"
import { FormItem, Select } from "../../../components"
import type { FilterRendererProps } from "../types"

const props = defineProps<FilterRendererProps<any>>()

const { filter, value, onChange } = toRefs(props)
</script>

<template>
  <FormItem :label="filter.label" :span="filter.span || 1">
    <Select
      class="pc-w-full"
      :modelValue="value"
      :options="filter.options"
      :placeholder="filter.placeholder"
      @update:modelValue="onChange"
    ></Select>
  </FormItem>
</template>
